require 'gadgets/combobox'
module EventEditor
  module Commands
    class BattleA
      def self.show(base, model, edit_command = [], options = {}, &func)
       @dialog = Gtk::Dialog.new("BattleA",
               base,
               Gtk::Dialog::MODAL,
               ["OK", Gtk::Dialog::RESPONSE_OK],
               ["Cancel", Gtk::Dialog::RESPONSE_CANCEL]
               )
               
        
        @model = model
        @dialog.vbox.add(self.create_panel)
        @dialog.vbox.show_all

        self.load(edit_command)
        
        @dialog.run do |response|
          if response == Gtk::Dialog::RESPONSE_OK
            p self.command
            func.call(self.command)
          end
        end
        @dialog.destroy
      end
      
      def self.create_panel
        ## Create document
        box = Gtk::VBox.new
        @battle_id_input = Gtk::Entry.new
        box.add(@battle_id_input)
        
        return box
      end
      
      def self.load(edit_command)
        if edit_command
          @battle_id_input.text = edit_command[1]
        end
      end
      
      def self.command
        return ['battle_a']
      end
      
      def self.command_to_s(model, args, margin = "")
        s = "BattleA Start"
        return s
      end
      
      def self.icon
        return @@icon
      end
    end
  end
end